package ro.ubbcluj.cs.damate.managers.management;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.io.Serializable;

/**
 * @author Lóránd Fazakas (lfazakas)
 *         Date: 2013.03.25.
 *         Time: 19:16
 */
@Component
@Scope("view")
public class ManagerView implements Serializable {

    public enum ManagerPanel {
        DESCRIPTION,
        NEW_SECTION,
        LIST_SECTIONS,
        NEW_TASK,
        LIST_TASKS,
        NEW_TEAM,
        LIST_TEAMS
    }

    private ManagerPanel activePanel;

    @PostConstruct
    private void init() {
        this.activePanel = ManagerPanel.DESCRIPTION;
    }

    public void switchPanel(String switchTo) {
        this.activePanel = ManagerPanel.valueOf(switchTo);
    }

    public ManagerPanel getActivePanel() {
        return activePanel;
    }

    public void setActivePanel(ManagerPanel activePanel) {
        this.activePanel = activePanel;
    }
}
